<h3><?php echo lang('cirpho_sample_list_title'); ?></h3>
<div class="align-left buttons buttons-small">
<?php echo anchor('cirpho/samples/upload', lang('cirpho_sample_upload_files'), 'class="open-files-uploader button"'); ?>
</div>
<?php if ($samples): ?>
	<?php echo form_open('cirpho/samples/delete/'.$groupId); ?>

	<table border="0" class="table-list">
		<thead>
		<tr>
			<th width="20"><?php echo form_checkbox(array('name' => 'action_to_all', 'class' => 'check-all')); ?></th>
			<th><?php echo lang('cirpho_sample_id_label'); ?></th>
			<th><?php echo lang('cirpho_sample_image_label'); ?></th>
			<th width="200" class="align-center"><span><?php echo lang('cirpho_sample_actions_label'); ?></span></th>
		</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="4">
					<div class="inner"><?php $this->load->view('admin/partials/pagination'); ?></div>
				</td>
			</tr>
		</tfoot>
		<tbody>
			<?php $this->load->library('image_lib');  ?>
			<?php foreach ($samples as $sample): ?>
			<tr>
				<td><?php echo form_checkbox('action_to[]', $sample->id); ?></td>
				<td><?php echo $sample->id; ?></td>
				<td>
					<a title="<?php echo $sample->image; ?>" href="<?php echo base_url() . $sampleFolderPath . $sample->image; ?>" rel="colorbox">
                		<?php
                			$this->image_lib->clear(); 
                			$config['image_library'] = 'gd2';
							$config['source_image'] = $imagePath.$sample->image;
							$config['new_image'] = $imageThumsPath.$sample->image;
							$config['create_thumb'] = TRUE;
							$config['thumb_marker'] = '';
							$config['maintain_ratio'] = TRUE;
							$config['width'] = $thumbWidth;
							$config['height'] = $thumbHeight;
							$this->image_lib->initialize($config);
							$this->image_lib->resize();
						?>
						<img title="<?php echo $sample->image; ?>" src="<?php echo base_url() . $thumFolderPath . $sample->image; ?>" alt="<?php echo $sample->image; ?>" />
            		</a>
            	</td>
				<td class="align-center buttons buttons-small">
					<?php echo anchor('admin/cirpho/samples/delete/'.$groupId.'/' . $sample->id, lang('cirpho_sample_delete_label'), 'class="confirm button delete"') ;?>
				</td>
			</tr>
			<?php endforeach; ?>
		</tbody>
	</table>

	<div class="buttons align-left padding-top">		
		<?php echo form_button(array('name'=> 'rebuild', 'type' => 'submit', 'content' => '<span>'.lang('cirpho_sample_rebuild_label').'</span>', 'class' => 'button'));?>
		<?php $this->load->view('admin/partials/buttons', array('buttons' => array('delete') )); ?>
	</div>

	<?php echo form_close(); ?>

<?php else: ?>
	<div class="blank-slate">
		<h2><?php echo lang('cirpho_sample_no_sample'); ?></h2>
	</div>
<?php endif; ?>

<div class="hidden">
	<div id="files-uploader">
		<div class="files-uploader-browser">
			<?php echo form_open_multipart('admin/cirpho/samples/upload/'.$groupId); ?>
				<label for="userfile" class="upload"><?php echo lang('cirpho_group_upload_label'); ?></label>
				<?php echo form_upload('userfile', NULL, 'class="no-uniform" multiple="multiple"'); ?>
			<?php echo form_close(); ?>
			<ul id="files-uploader-queue" class="ui-corner-all"></ul>
		</div>
		<div class="buttons align-right padding-top">
			<a href="#" title="" class="button start-upload"><?php echo lang('cirpho_group_upload_label'); ?></a>
			<a href="#" title="" class="button cancel-upload"><?php echo lang('buttons.cancel');?></a>
		</div>
	</div>
</div>
<!--
<div id="files-browser">
	<nav id="files-browser-nav">
		<?php echo $template['partials']['nav']; ?>
	</nav>
	<div id="files-browser-contents">
		<?php echo $content; ?>
	</div>
</div>
-->
<script type="text/javascript">
(function($){
	// Store data for filesUpload plugin
	$('#files-uploader form').data('fileUpload', {
		lang : {
			start : 'Start',
			cancel : '<?php echo lang('cirpho_sample_delete_label'); ?>'
		}
	});
})(jQuery);
</script>
